using System;

public class IdleMobLogic : BaseMobLogic
{
	private static Random random = new Random();

	public override void OnStart(LogicController contriller, string enterFromLogic, params object[] args)
	{
		base.OnStart(contriller, enterFromLogic);
		LogicEvent(5);
		if (args.Length == 2 && (float)args[1] > 0f)
		{
			StartTimer(random.Next((int)((float)args[0] * 1000f), (int)(float)args[1] * 1000), false);
		}
		else
		{
			OnTimerTick();
		}
	}

	public override void OnTimerTick()
	{
		ChangeLogic("Walk");
	}

	public override void OnEvent(int name, params object[] args)
	{
		switch ((mobAssignerEvent)name)
		{
		case mobAssignerEvent.CanNotFindPathToNearestPoint:
			break;
		case mobAssignerEvent.Chase:
		{
			EnemyBehavior enemyBehavior2 = (EnemyBehavior)args[1];
			if (enemyBehavior2.behaviorModel == BehaviorModel.Passive || enemyBehavior2.behaviorModel == BehaviorModel.Aggressive || enemyBehavior2.behaviorModel == BehaviorModel.Police)
			{
				ChangeLogic("Chase", args[0], enemyBehavior2.enemyAreaBehavior.aggressiveDistance);
			}
			else
			{
				ChangeLogic("Escape", args[0], enemyBehavior2.enemyAreaBehavior.aggressiveDistance);
			}
			break;
		}
		case mobAssignerEvent.TargetInShootRande:
		{
			EnemyBehavior enemyBehavior = (EnemyBehavior)args[1];
			if (enemyBehavior.behaviorModel == BehaviorModel.Passive || enemyBehavior.behaviorModel == BehaviorModel.Aggressive || enemyBehavior.behaviorModel == BehaviorModel.Police)
			{
				ChangeLogic("Spoot", args[0], enemyBehavior.enemyAreaBehavior.aggressiveDistance);
			}
			break;
		}
		default:
			base.OnEvent(name, args);
			break;
		}
	}

	public override void OnStop()
	{
		base.OnStop();
	}
}
